var rankData = require('./rankData')();
var GameData = require('../../module/GameData')();

cc.Class({
    extends: cc.Component,

    properties: {
        Allrank: cc.SpriteAtlas,
        back_icon: cc.Sprite,
        back_dsc: cc.Label,
        check_icon: cc.Sprite,
        check_dsc: cc.Label,

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
    },
    init(data) {
        this.back_icon.getComponent(cc.Sprite).spriteFrame = this.Allrank.getSpriteFrame(data.back_icon);
        this.back_dsc.string = data.back_dsc;
        this.check_icon.getComponent(cc.Sprite).spriteFrame = this.Allrank.getSpriteFrame(data.check_icon);
        this.check_dsc.string = data.check_dsc;
        this.node.id=data.id;
    },

    start() {

    },
    selectBtn() {
        GameData.rank.select_rank(this.node.id);

    },

    // update (dt) {},
});
